package com.zgg.files.controller;


import com.alibaba.fastjson.JSONObject;
import com.zgg.config.AliOssProperties;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.web.bind.annotation.*;

@RequestMapping("/test")
@RestController
public class TestController {
    private Logger logger = LoggerFactory.getLogger(TestController.class);

    @Autowired
    private Environment env;

    @Autowired
    private AliOssProperties aliOssProperties;

    /**
     * @param
     * @return
     */
    @RequestMapping(value = "/test/{name}", method = RequestMethod.GET)
    public JSONObject appId(@PathVariable String name) {
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("status", 200);
        jsonObject.put("msg", "请求成功");
        jsonObject.put("name", aliOssProperties.toString());
        logger.debug(name);
        return jsonObject;
    }
}
